#!/bin/sh
#
# JAVA wrapper
#

SELFDIR=`dirname $0`

JAVA=`type -p java`
#JAVA=/usr/java/jre1.6.0/bin/java

if [ ! -d "$ORACLE_HOME" ]; then
	echo "No ORACLE_HOME configured!"
	exit 1
fi


if [ ! -x "$JAVA" ]; then
	echo "No JAVA configured! Please edit $0 script to include Java RunTime path"
	exit 1
fi

CLASSPATH=$CLASSPATH:.:$SELFDIR:$SELFDIR/orajdbcstat.jar
export CLASSPATH

#LD_LIBRARY_PATH=/u01/app/oracle/product/11.1.0/db_1/lib
#LD_LIBRARY_PATH=/usr/local/lib/oracle/instantclient_11_1
LD_LIBRARY_PATH=/opt/instantclient_11_2
export LD_LIBRARY_PATH
# local diretory
#TNS_ADMIN=`pwd`
TNS_ADMIN=$SELFDIR
export TNS_ADMIN

#####################

cd $SELFDIR || exit 100
$JAVA -jar orajdbcstat.jar $@
exit $?

